﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BoxScore.compartidas
{
    public partial class _volver : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    this.ViewState["origen"] = GetRefererURL();
                }
                catch { }
            }

        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            Regresar(ViewState["origen"]);
        }

        public static void Regresar(object sURL)
        {
            try
            {
                HttpContext.Current.Response.Redirect(sURL.ToString());
            }
            catch { }
        }

        public static string GetRefererURL()
        {
            try
            {
                return HttpContext.Current.Request.UrlReferrer.PathAndQuery;
            }
            catch
            {
                return "";
            }
        }
    }
}